package docsync;

import java.util.List;

import docsync.doclist.DocListRequest;

public class GoogleDocSync {

	private GoogleFolder googlefolder;
	private FolderInterface localfolder;
	private FolderSync sync;

	public GoogleDocSync(FolderInterface local, String username, String password) {
		DocListRequest dlr = new DocListRequest(username, password);
		this.googlefolder = new GoogleFolder(new ExtensionMapper(), dlr);
		this.localfolder = local;
		this.sync = new FolderSync(localfolder, googlefolder);
	}

	public FileInterface[] getRemoteFiles() throws Exception {
		return this.googlefolder.getFiles();
	}

	public FileInterface[] getLocalFiles() throws Exception {
		return this.localfolder.getFiles();
	}

	public List<FolderSync.Action> synchronize() throws Exception {
		return this.sync.sync();
	}
}
